<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="pragma" content="no-cache"> 
<meta http-equiv="Cache-Control" content="no-cache,  no-store,must-revalidate"> 
<meta http-equiv="expires" content="0"> 
<title>被保险人</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<link rel="stylesheet"
	href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
<link rel="stylesheet" href="assets/css/rz.css">
 
</head>
<body>
	<div class="page-group">
		<div class="page page-current" id="index">
			<header class="bar bar-nav">
				<a href="promotion/buy3" id="back" class="button button-link button-nav pull-left back" external>
					<span class="icon icon-left"></span> 返回
				</a>
				<!--href="javascript:" onclick="self.location=document.referrer;" href="promotion/buy" -->
				<!-- <a href="page/index" class="button button-link button-nav pull-right">
   					 首页
			    	<span class="icon icon-right"></span>
			    </a> -->
				<h1 class='title'>被保险人</h1>
			</header>
			
			<div class="content">
				<div class="card">
					<div class="card-header"><b>被保险人员信息</b></div>
					<form action="promotion/saveEnsureperson" method="post">
					<div class="card-content">
						<div class="list-block">
							<ul>
								<!-- Text inputs -->
								<li>
									<div class="item-content">
										<div class="item-media">
											<i class="icon icon-form-name"></i>
										</div>
										<div class="item-inner">
											<div class="item-title label">姓名</div>
											<div class="item-input">
												<input name="name" id="name" type="text"  value="${insuredper.name }" placeholder="请输入真实姓名">
											</div>
										</div>
									</div>
								</li>
								<li>
									<div class="item-content">
										<div class="item-media">
											<i class="icon icon-form-gender"></i>
										</div>
										<div class="item-inner">
											<div class="item-title label">性别</div>
											<input name="gender" type="text" id='gender' value="${insuredper.gender }" placeholder="请选择性别"/>
										</div>
									</div>
								</li>
								<li>
									<div class="item-content">
										<div class="item-media">
											<i class="icon icon-form-gender"></i>
										</div>
										<div class="item-inner">
											<div class="item-title label">证件类型</div>
											<input name="identityType" type="text" id='identityType' value="${insuredper.identityType }" placeholder="请选择证件类型"/>
										</div>
									</div>
								</li>
								<li>
									<div class="item-content">
										<div class="item-media">
											<i class="icon icon-form-name"></i>
										</div>
										<div class="item-inner">
											<div class="item-title label">证件号码</div>
											<div class="item-input">
												<input name="identityCode" type="text" id='identityCode' value="${insuredper.identityCode }" placeholder="请输入证件号码">
											</div>
										</div>
									</div>
								</li>
								<c:choose>
								<c:when test="${insuredper.name==customer.name }">
								<li>
									<div class="item-content">
										<div class="item-media">
											<i class="icon icon-form-name"></i>
										</div>
										<div class="item-inner">
											<div class="item-title label">初始保费</div>
											<div class="item-input">
												<label>${100- 5*(insuredpersonsize-1)}%</label>
											</div>
										</div>
									</div>
								</li>
								</c:when>
								<c:otherwise>
								<li>
									<div class="item-content">
										<div class="item-media">
											<i class="icon icon-form-name"></i>
										</div>
										<div class="item-inner">
											<div class="item-title label">与投保人的关系</div>
											<div class="item-input">
												<input name="relationship" id="relationship" type="text" value="${insuredper.relationship }" placeholder="请输入与投保人的关系">
											</div>
										</div>
									</div>
								</li>
									<li>
									<div class="item-content">
										<div class="item-media">
											<i class="icon icon-form-name"></i>
										</div>
										<div class="item-inner">
											<div class="item-title label">初始保费</div>
											<div class="item-input">
												<label>5%</label>
											</div>
										</div>
									</div>
								</li>
								</c:otherwise>
								</c:choose>
							</ul>
						</div>
						<input type="hidden" name="id" value="${id}"/>
						<div class="content-block">
							<br>
							<div class="row">
								<div class="col-100">
									<input type="submit" class="button button-big button-fill button-success" value="保&nbsp;&nbsp;&nbsp;&nbsp;存"/>
									<br>
									<c:if test="${id>-1 && insuredper.name!=customer.name}">
								<a class="button button-big button-fill button-success" href="promotion/delEnsureperson?id=${id}"
									external> 删除</a></c:if>
								</div>
								<br><br>
							</div>
						</div>
					</div>
					</form>
					<div class="card-footer"></div>
				</div>
				<%@ include file="/include/footer.jsp"%>
			</div>

		</div>

	</div>
	<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>

	<script>
	$("#gender").picker({
			toolbarTemplate: '<header class="bar bar-nav">\
			<button class="button button-link pull-right close-picker">确定</button>\
			</header>',
			cols: [
		 {
  		textAlign: 'center',
 		 values: ['男', '女']
			 }
			 ]
	});			
	$("#identityType").picker({
			toolbarTemplate: '<header class="bar bar-nav">\
			<button class="button button-link pull-right close-picker">确定</button>\
			</header>',
			cols: [
		 {
  		textAlign: 'center',
 		 values: ['身份证', '护照', '军官证']
			 }
			 ]
	});
	</script>
</body>
</html>